package at.fpmedv.eclipse.helma.core;

import java.util.Comparator;

import org.eclipse.core.runtime.IAdaptable;

import at.fpmedv.eclipse.helma.util.ResourceContainer;

/**
 * interface for all Tree Leaf Objects
 */
public interface ITreeObject extends IAdaptable {
	
	/**
	 * getter for human readable name of object
	 * @return name of object
	 */
	public String getName();

	/**
	 * getter for human readable name of object without view modifications
	 * @return name of object
	 */
	public String getRawName();

	/**
	 * never needed
	 */
	public Object getAdapter(Class key);

	/**
	 * getter for parent
	 * @return the parent object
	 */
	public ITreeParent getParent();

	/**
	 * getting the resource to this object (mostly a file)
	 * @return the File Resource
	 */
	public ResourceContainer getResource();

	/**
	 * compares this against element
	 * 
	 * @param element the element that should be compared
	 * @param comparator for the alphabetic sorting
	 * 
	 * @return -1 if smaller, 0 if equal and 1 if element is bigger
	 */
	public int compare(ITreeObject element, Comparator comparator);
}
